Ruby - How to filter SQLite rows based on column conditions

join shbcf.ru